草庐IT

Android NDK clang 编译器找不到 std::make_unique

全部标签

GoLang 在运行时强制计算,而不是编译时

我正在做一个项目,该项目应该有64位或32位版本。由于第3方驱动程序,我被迫使用int,而不是int64。const(_=iota//ignorezeroiotaKiB=1不幸的是编译器报错,我得到一个constant5368709120overflowsint错误。我怎样才能有效地解决这个问题?有什么方法可以强制在运行时进行这个5*GiB计算? 最佳答案 只需将变量显式键入int64而不是平台相关的int:varThirdPartyDriverBytesint64const(_int64=iota//ignorezeroiotaK

golang 在子目录中找不到包 gin

我收到以下错误消息:controllers/user.go:4:2:cannotfindpackage"(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin"inanyof:/usr/local/go/src/(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin(from$GOROOT)/home/ubuntu/goapi/src/_(undersc

c - 找不到gmp库

我试着安装依赖gmp的pbc库。Dockerfile:FROMgolang:1.9.6-alpine3.7RUNmkdir-p/go/src/appWORKDIR/go/src/appCOPY./go/src/appRUNapkadd--updategitgccbuild-baseflexbisongmpRUNwgethttps://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz&&\tar-xvfpbc-0.5.14.tar.gz&&\cdpbc-0.5.14&&\./configure--prefix=$HOME/.local&&\m

Golang `go get` - 找不到任何包

我关注了thisguide在Ubuntu16.04上安装Go。但是,当我按照installationinstructions对于Go应用程序(gogetgithub.com/src-d/enry/cmd/enry),我收到以下错误:packagegithub.com/src-d/enry/v2:cannotfindpackage"github.com/src-d/enry/v2"inanyof:/usr/local/go/src/github.com/src-d/enry/v2(from$GOROOT)/root/work/src/github.com/src-d/enry/v2(fr

html - 系统找不到试图解析模板的指定路径

我刚刚开始学习Go中的html/模板。我收到的错误是“系统找不到指定的文件路径”。文件路径为templates/time.html。time.html(我要呈现的页面)的位置是src/templates/time.html我的gomain的位置是src/timeserver/timerserver.go这是我使用的代码funcTimeServer(whttp.ResponseWriter,req*http.Request){//ifusergoestoanotherwebsiteaftertime/...ifreq.URL.Path!="/time/"{errorHandler(w,r

linux - 构建 cf-cli : go build runtime: linux/386 must be bootstrapped using make. bash 时出错

CloudFoundry的CLI工具位于cloudfoundry/cli是用围棋写的。我正在尝试构建CLI工具但出现此错误:gobuildruntime:linux/386必须使用make.bash引导如何解决这个问题?下面是cli/bin/build-all.sh脚本的内容:#!/bin/bashset-eset-xOUTDIR=$(dirname$0)/../outGOARCH=amd64GOOS=windows$(dirname$0)/build&&cp$OUTDIR/cf$OUTDIR/cf-windows-amd64.exeGOARCH=386GOOS=windows$(di

go - 无法使用自制软件安装编译在 OS X 上导入 net/http 的程序

我已经在我的OSX10.10机器上安装了gousingHomebrew。每次我尝试编译导入net/http的示例应用程序时,我都会收到以下错误:loadcmd/cgo:packagecmd/cgo:noGosourcefilesin/Users/bbaron/google_appengine/goroot/src/cmd/cgo我的GOPATH变量设置正确($HOME/go)并且我的目录结构看起来是正确的:/Users/bbaron/go/src/github.com/einsteinx2/gamenotifier/Users/bbaron/go/src/github.com/eins

google-app-engine - golang 数据存储结构 : keeping field unique and required

我想知道如何最好地保证一个字段是唯一的,如果不是,则不会保存到数据存储中。另外,它应该是必需的。我将此字段用作stringID并需要它是唯一的。我知道我可以简单地尝试通过该字段获取实体并查看它是否存在并围绕它构建逻辑。但是有没有更简单的方法,比如在您的结构中声明该字段应该是唯一的和/或必需的?就像下面的模型。typeCarstruct{Regnrstring"required""unique"}谢谢! 最佳答案 来自数据存储API:Bydefault,forstructpointers,allpropertiesarepotenti

带有inotifywait的正则表达式在golang中编译两种类型的文件

我使用script使用inotifywait在golang中自动编译。但是这个脚本只检查扩展名为.go的文件。我还想添加.tmpl扩展名,但脚本使用正则表达式。我必须对此行进行哪些更改才能获得所需的结果?inotifywait-q-m-r-eclose_write-emoved_to--exclude'[^g][^o]$'$1我试过连接|或&和其他类似([^t][^m][^p][^l]|[^g][^o])$但似乎没有任何效果。 最佳答案 与其尝试使用正则表达式来排除两种类型的文件,不如只看那些文件?inotifywait-q-m-r

Golang 包导入 - 找不到包

这是我第一次在这里提问,无论如何,我想知道为什么它说找不到包,即使github.com/JohnDoe/temperature/conversion/conv是在$GOPATH中[johndoe@johndoetemperature]$gorunmain.gomain.go:5:2:cannotfindpackage"github.com/JohnDoe/temperature/conversion/conv"inanyof:/usr/local/go/src/github.com/JohnDoe/temperature/conversion/conv(from$GOROOT)/hom